package emp.jsf.servicio.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;  
import org.springframework.stereotype.Service;  

import emp.jsf.servicio.MarcaService;
import emp.repositorios.MarcaRepository;
import emp.entidades.EntMarca;

@Service("MarcaService")
public class MarcaServiceImpl implements MarcaService {
	
	@Autowired
	MarcaRepository marcaRepository;
	
	public List<EntMarca> buscarMarca(){
		return marcaRepository.findAll();
	}
	
	public EntMarca grabarMarca(EntMarca ent){ 
		return marcaRepository.save(ent);
	}
	
	public void eliminar(String id){ 
		EntMarca ent=marcaRepository.findOne(Long.valueOf(id));
		marcaRepository.delete(ent);
	}
	
}
